package com.hll;

import cn.hutool.core.io.FileUtil;
import cn.hutool.http.HttpUtil;
import com.aos.iot.protocol.hll.EnableHllProtocol;
import com.aos.iot.socket.tcp.annotation.EnableSocketTcpServer;
import com.aos.iot.socket.udp.annotation.EnableSocketUdpServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;


//@EnableSocketIoServer
@EnableSocketTcpServer
@EnableSocketUdpServer
@EnableHllProtocol
@SpringBootApplication
public class IotServerApplication {

    public static void main(String[] args) {
        SpringApplication.run(IotServerApplication.class, args);
//        String privateKeyStr1 = "MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAKAV+FAH7JKSmGYaZJ3gq7i/ZjM5vLKkBWOC3X7pNQ4mdyGZvoyVqIJWIPmdbGjGcH2oPxT93W6Wij5R+4VKFDQ9gRkKEN+McjOB7YDkEX7371xzZjTeVQka1ALUZYW8EtDuGVOnfAnjtnrJQSXfkDKgBQs5MrYJTyBn6m6MCCUfAgMBAAECgYEAjEpUnwYiu1x+89OjY3wV4UTSsoehp0f4dPmlVGfZF/p7olWS2K76yqXiJf5gl/13bZd5GNNVL2n74puD+Y4u3yhILBGId0to/mtC8HeVzOhgWS7tsk9DYFDc/OGTVkQlAOEgoWR839uv6PTfM8DxqlAhPp7W8eRLOTq+f3H0jVkCQQDhIbQeL+x/+cePjzXuqv8/yUklajxTyAWPv/OfwtPKAVZCXvpR+d6HPeecp5QJNKdvcfs+3ijXjDabiGReIU2rAkEAtgkbYEs6KX/8kJ3dcFDI7SVMHfPDh6jOshZ/q+DIUKFQWhtWxmPfAQZQ+pQet1vz4Ftwphw5mGsi7tym9fLKXQJBAIQ3gAnOiW2raxkTuU/e2yNB+pRfrOhja2i+Cb1E9Y8Ic/lswEROo/L3V0P4Ywd5BfB8l1qXrJLShOuZEaD6nBsCQQCNi+dNqTFAs9SgXyChBTA3tpjJcZLJGeofcH82F0Or7sOcTUXcXiw5j7/IGQUJbubjvjaJ88iVTD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/8/DLk9hKKaGmWw6PuTSASlkDJIsADQJAQfBybK9U2Os6M/c7Z5meYx0PQN7ekVb42ITQRlwlECqFEqUA1P00a9T3UIxzPCXoZ3F6YdSI3fVI6hSC7cdi+Q==";
//        String publicKeyStr2 = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCSmDEZcesLsPC+w/D+5Bdt6YRt2q92GqwdHUmeZ7jBn8Uxgf7TZ3GbLj4aG2nmYrLLngg5zXPaeUj52HobPWpqsyN8Pyxc1bHKUG9H7+3jwQZe8KQN1XIRXgo6+WgSVEEWhJBJoG8P+zRif9cH+JMs0B+2OLe3CpxcsBQwl1izFwIDAQAB";
//
//        String l = DateUtil.parse("2022-10-31 23:59:59").getTime() + "";
//        System.out.println(l);
//        RSA rsa1 = new RSA(privateKeyStr1, publicKeyStr2);
//        String aa = Base64.encode(rsa1.encrypt(StrUtil.bytes(l, CharsetUtil.CHARSET_UTF_8), KeyType.PublicKey));
//        System.out.println(aa);
//        RSA rsa2 = new RSA(privateKeyStr2, publicKeyStr1);
//        String bb = rsa2.decryptStr(aa, KeyType.PrivateKey);
//        System.out.println(bb);
    }
}
